package com.yunkeji.dao.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 关注-粉丝对象 ykj_user_focus
 *
 * @author 老张
 * @date 2024-05-27
 */
@Data
@TableName("ykj_user_focus")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserFocus extends Model<UserFocus> {

    private static final long serialVersionUID = 1L;
    /**
     * 排序id
     *
     * @author 老张
     */
    @TableId(value = "sort_id")
    private String sortId;
    /** 谁关注的 */
    private Long fansUserId;
    /** 关注了谁 */
    private Long focusUserId;
    /** 谁关注的 */
    private Long fansPlatformId;
    /** 关注了谁 */
    private Long focusPlatformId;
    /**
     * 亲密值
     *
     * @author 老张
     */
    private BigDecimal loveValue;

    /**
     * 是否删除
     *
     * @author 老张
     */
    // @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    public String getSortIdStr() {
        return this.fansUserId > this.focusUserId
                ? fansUserId + "" + focusUserId
                : focusUserId + "" + fansUserId;
    }
}
